-
Notifications
You must be signed in to change notification settings - Fork 2k
Add dynamic theming for gum #4467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
|
Can you show some images of where this improves things? The gum styling we have now is already derived from the terminal colors that are theme dependent. |
Added some example screenshots. |
7d49697 to
76a6782
Compare
|
That's a clear improvement. Just a few notes and we can merge this 👌 |
default/bash/rc
Outdated
| source ~/.local/share/omarchy/default/bash/functions | ||
| source ~/.local/share/omarchy/default/bash/init | ||
| source ~/.local/share/omarchy/default/bash/envs | ||
| [[ -f $HOME/.config/omarchy/current/theme/gum.envs ]] && source $HOME/.config/omarchy/current/theme/gum.envs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the simplicity of this, but then it would only apply to new terminals opened. Not existing ones, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I just realized that then the theming also only applies to user bash shells, so scripts like omarchy-menu which don't source the ~/.bashrc file don't set the environment variables. (If they are started using a keyboard shortcut.)
I think setting the variables via hyprland might be the easiest approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, fine to set via hyprland. Then we actually get reloading for free. You shouldn't even have to call hyprctl reload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, in this case I just reverted the last commit and keep it in the default/themed/hyprland.conf.tpl (since adding something like a default/themed/gum.env.conf.tpl, which then also gets added as a config to hyprland will probably just we more confusing than helpful).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer having this in a separate file. Hyprland doesn't have a problem with includes. So we should use use gum.env.conf and then link those from the default hyprland config inside omarchy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now added a separate gum.env.conf.tpl file for this.
e4c0606 to
ecb455f
Compare
migrations/1769993645.sh
Outdated
| @@ -0,0 +1,4 @@ | |||
| #!/bin/bash | |||
|
|
|||
| # reapply the current theme (also restarts hyprland to add the gum env variables) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are no longer restarting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the migration script to also add the new gum.env.conf to the user's hyprland.conf.
Migration script just runs omarchy-theme-restart. The gum.env.conf file gets sourced in the default/hypr/envs.conf file.
Summary
This adds dynamic theming for gum by using the colors from the current theme.
Why
The
gumcli tool is used quite extensively in omarchy scripts and it's default pink theme can look quite out of place.Remark
I don't like how this requires to add a lot of different environment variables. Sadly it doesn't seem like
gumprovides a "global theme" setting, so this might still be the best option.To avoid having all those variables in the environment, we could add a bash function which shadows
gumand adds the variables just for this scope.Examples
first image is before, second is after
Catppuccin: Install > Web App
Catppuccin Latte: Remove > TUI
Matte Black: Update > Omarchy
Rose Pine: Install > Web App